package org.example.pms.service.impl;

import org.example.pms.domain.VaccineResult;
import org.example.pms.mapper.VaccineResultMapper;
import org.example.pms.service.VaccineResultService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class VaccineResultServiceImpl implements VaccineResultService {

    @Resource
    VaccineResultMapper vaccineResultMapper;

    @Override
    public VaccineResult getVaccineResultById(Integer id) {
        VaccineResult vaccineResult = vaccineResultMapper.selectById(id);
        return vaccineResult;
    }

    @Override
    public List<VaccineResult> getVaccineResultByPatientId(Integer patientId) {
        List<VaccineResult> vaccineResults = vaccineResultMapper.selectByPatientId(patientId);
        return vaccineResults;
    }

    @Override
    public Integer addVaccineResult(VaccineResult vaccineResult) {
        int insert = vaccineResultMapper.insert(vaccineResult);
        return vaccineResult.getId();
    }
}
